package com.molichuxing.job;

import com.molichuxing.service.OrderJobService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 *  op 商家订单未还款预警  采购订单还款日前3天触发
 */
@JobHandler(value = "orderDealerReminderToServicerHandle")
@Component
public class OrderDealerReminderToServicerHandle extends IJobHandler {
    private static final Logger logger = LoggerFactory.getLogger(OrderDealerReminderToServicerHandle.class);

    @Resource
    private OrderJobService orderJobService;

    public OrderDealerReminderToServicerHandle() {
        super();
    }

    @Override
    public void init() {
        super.init();
    }

    @Override
    public void destroy() {
        super.destroy();
    }

    @Override
    public ReturnT<String> execute(String param) throws Exception {
        ReturnT<String> returnT = ReturnT.SUCCESS;
        logger.info("==============给业务人员发送各种提醒定时任务start================");
        try {
            // 还款提醒告知
            orderJobService.orderDealerRepayReminderToServicer();
        } catch (Exception e) {
            // TODO: handle exception
        }
        logger.info("==============给业务人员发送各种提醒定时任务end================");
        return returnT;
    }

}
